
import styles from './beiyou.css';
import axios from 'axios'
import React, { Component } from 'react'

export default class Beiyou extends Component {
  constructor(props) {
    super(props)
    this.state = {
      list: []
    }
  }
  render() {
    return (
      <div className={styles.box}>
        <h2>北京虚拟旅游</h2>
        <ul className={styles.list01}>
          {
            this.state.list.map((item, i) => {
              return (
                <li key={i}>
                  <div>
                    <img src={item.pimg} alt="" />
                  </div>
                  <h5>{item.pname}</h5>
                </li>
              )
            })
          }

        </ul>
      </div>
    )
  }

  componentDidMount() {
    axios({
      url: 'http://jx.xuzhixiang.top/ap/api/productlist.php',
      params: { uid: 19802 }
    }).then((res) => {
      console.log(res)
      this.setState({
        list: res.data.data
      })
    })
  }
}

